//
//  PacketCenter.h
//  QBIM
//
//  Created by liunian on 14-3-17.
//  Copyright (c) 2014年 liunian. All rights reserved.
//

#import <Foundation/Foundation.h>
#import "BodyBase.h"

@class PacketCenter;
@protocol PacketDelegate <NSObject>

@optional
- (void)packetCenterDidConnectServer:(PacketCenter *)packetCenter;
- (void)packetCenterDidDisConnectServer:(PacketCenter *)packetCenter;
- (void)packetCenter:(PacketCenter *)packetCenter didDisconnectWithError:(NSError *)err;

- (void)packetCenter:(PacketCenter *)packetCenter sendErrorPacket:(NSData *)packet;
- (void)packetCenter:(PacketCenter *)packetCenter didReceivedData:(NSData *)data;

@end
@interface PacketCenter : NSObject
@property (nonatomic, assign) id<PacketDelegate>delegate;

-(BOOL)isConnected;
-(void)disConnect;

- (void)sendPacket:(NSData *)packet;

@end
